package cn.tedu.micro.demo.device.service;

import cn.tedu.micro.demo.device.common.pojo.po.GunInfoPO;
import cn.tedu.micro.demo.device.common.pojo.vo.GunInfoVO;
import cn.tedu.micro.demo.device.repository.GunRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class GunServiceImpl implements GunService{
    @Autowired
    private GunRepository gunRepository;

    @Override
    public GunInfoVO selectById(Long gunId) {
        GunInfoPO gunInfoPO = gunRepository.selectById(gunId);
        if(gunInfoPO != null){
            GunInfoVO gunInfoVO = new GunInfoVO();
            gunInfoVO.setId(gunInfoPO.getId());
            gunInfoVO.setStatus(gunInfoPO.getStatus());
            gunInfoVO.setType(gunInfoPO.getType());
            return gunInfoVO;
        }
        return null;
    }
}
